AJUST_STEP = 5
a = 1
a = a +1
class ypr_pid:
    def __init__(self):
        self.pitch = [60,0,20]
        self.roll = [60,0,20]
        self.yaw = [30,0,0]

    def change_pitch(self,pid,up_down):
        if(up_down == 0):
            self.pitch[pid] = self.pitch[pid] - AJUST_STEP
            return self.pitch[pid]
        elif(up_down == 1):
            self.pitch[pid] = self.pitch[pid] + AJUST_STEP
            return self.pitch[pid]
    def change_roll(self,pid,up_down):
        if(up_down == 0):
            self.roll[pid] = self.roll[pid] - AJUST_STEP
            return self.roll[pid]
        elif(up_down == 1):
            self.roll[pid] = self.roll[pid] + AJUST_STEP
            return self.roll[pid]

    def change_yaw(self,pid,up_down):
        if(up_down == 0):
            self.yaw[pid] = self.yaw[pid] - AJUST_STEP
            return self.yaw[pid]
        elif(up_down == 1):
            self.yaw[pid] = self.yaw[pid] + AJUST_STEP
            return self.yaw[pid]

COMMAND_LIST = [["pp+","pp-"],
                ["pr+","pr-"],
                ["py+","py-"],
                ["ip+","ip-"],
                ["ir+","ir-"],
                ["iy+","iy-"],
                ["dp+","dp-"],
                ["dr+","dr-"],
                ["dy+","dy-"]
                ]
def change_pid(command,ypr_pid):
    for i,J in enumerate(COMMAND_LIST):
        if(J[0] == command):
            if(i%3 == 0):
                val = ypr_pid.change_pitch(i//3,1)
                break
            elif(i%3 == 1):
                val =ypr_pid.change_roll(i//3,1)
                break
            elif(i%3 == 2):
                val =ypr_pid.change_yaw(i//3,1)
                break
        elif(J[1] == command):
            if(i%3 == 0):
                val =ypr_pid.change_pitch(i//3,0)
                break
            elif(i%3 == 1):
                val =ypr_pid.change_roll(i//3,0)
                break
            elif(i%3 == 2):
                val =ypr_pid.change_yaw(i//3,0)
                break
    return command[0:2] + str(val)

if __name__ == "__main__" :
    my_ypr_pid = ypr_pid()
    for i in COMMAND_LIST:
        for j in i:
            my_str = change_pid(j,my_ypr_pid)
            print(my_str)
    
    # for i,j in enumerate(command_list):
    #     print(str(i) + j[0])
    print(4%3)
    print(4//3)
    print(a)
    # print(1)